package com.kele.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.unit.DataSize;

import javax.servlet.MultipartConfigElement;
import java.io.File;

/**
 * @Version 2019
 * @Author:kele
 * @Date:2021/4/19
 * @Content:
 * @Description：
 */

@Configuration
public class CommonConfig {

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize(DataSize.ofBytes(102400000));
        factory.setMaxRequestSize(DataSize.ofBytes(102400000));

        return factory.createMultipartConfig();
    }
}
